<%@ include file="/WEB-INF/jsp/include/include.jsp" %>
<html>
<head>
</head>
<body>
<div class="row" style="text-align:right;">
	<form:form cssClass="well form-search" action="${ctx}collect.htm" modelAttribute="bonus" method="post">
		<form:hidden path="user.id" value="${SPRING_SECURITY_CONTEXT.authentication.principal.id}" />
		<form:hidden path="user.balance" value="${user.balance}" />
		<form:select path="rule" cssClass="input-small">
			<form:options items="${rules}" itemLabel="action" itemValue="id" />
		</form:select>
		<spring:bind path="code">
			<input name="code" class="input" type="text" placeholder="<fmt:message key='bonus.hit' />">
		</spring:bind>
		
		<button class="btn" type="submit"><fmt:message key="common.submit" /></button>
		<c:if test="${status == 'success'}"><div class="alert alert-success"><fmt:message key="message.collect.success" /></div></c:if>
		<form:errors path="rule" element="div" cssClass="alert alert-error" />
		<form:errors path="code" element="div" cssClass="alert alert-error" />
	</form:form>
</div>
<div class="row preview">
	<div class="span4" style="width:100%;text-align:center;"><h1><fmt:message key="bonus.current" />${user.balance}<fmt:message key="bonus.unit" /></h1></div>
</div>
<div class="row index" style="text-align:center;"><a class="btn btn-primary" href="${ctx}records.htm?id=${SPRING_SECURITY_CONTEXT.authentication.principal.id}"><i class="icon-ok icon-white"></i><fmt:message key="users.viewBonus" /></a></div>
</body>
</html>